import DelButton from '../../components/delbutton';
import Table from '../../components/table';
import { IData } from '../api/classgroup/content/query.api';
import Edit from './edit';
import { Message as M1, Result as R1 } from '../api/classgroup/list/edit.api';
import api from '../../atoms/api';


export default function List({ data }: { data: IData[] }) {
	return <>
		<Table
			idfieldname='group_id'
			data={data}
			render={(record) => {
				const group_id = record.group_id;
				return <>
					<Edit data={record} />
					<DelButton query={{
						group_id
					}} dlgtitle='确认删除' api={api['/api/classgroup/list/del']} />
				</>;
			}}
		>
			<Table.Column<IData> title='课组名称' key='groupname' dataIndex='groupname' align='left' />
			<Table.Column<IData> title='课组简介' key='groupintroduce' dataIndex='groupintroduce' align='left' />
		</Table>
	</>;
}
